API queries for list=allcategories with acdir=descending had the
acmin and acmax parameters in reverse, that is min behaved like max
and max behaved like min. This patch fixes the issue.
Change-Id: If6346b682782856ffa5b15d08abd1b2ecc50424c
$min = $params['min'];
$max = $params['max'];
- $this->addWhereRange( 'cat_pages', $dir, $min, $max );
+ if ( $dir == 'newer' ) {
+ $this->addWhereRange( 'cat_pages', 'newer', $min, $max );
+ } else {
+ $this->addWhereRange( 'cat_pages', 'older', $max, $min);
+ }
+
if ( isset( $params['prefix'] ) ) {
$this->addWhere( 'cat_title' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) );